package com.zx._09_架构.重构;

/**
 * @program: knowledge
 * @description:
 * @author: xue.zhang
 * @create: 2021-11-17 11:39
 */
public class Idea快速重构代码 {

    public int plus(int a) {
        if (a <= 1) {
            return a;
        }
        // 选中代码，右键，refactor, extract method
        int res = 1;
        for (int i = 1; i <= a; i++) {
            res *= i;
        }
        return res;
    }
}
